import java.util.Arrays;

public class text5 {
    public static int[] fun5(int[] array,int target){
        int[] arr=new int[2];
        for(int i=0;i< array.length;i++){
            int m=target-array[i];
            for(int j=0;j< array.length;j++){
                if(j==i){
                    continue;
                }
                if(array[j]==m){
                    arr[0]=i;arr[1]=j;
                    return arr;
                }
            }
        }
        return null;
    }
    public static void main(String[] args) {
        int[] array={1,2,3,4,5,6,7,8,9};
        int[] ret=fun5(array,6);
        System.out.println(Arrays.toString(ret));
    }
}
